Introduction
This note is based on SIGGRAPH course of 2012, which introduced basic techniques to simulate elastic material using FEM.
Elastisity in 3D
Deformation and deformation gradient
X∈Ω is the location of material in undeformed position, and the deformation function ϕ:R3→R3 transfer material to its current position.
define deformation gradient F as:
F=∂(ϕ1,ϕ2,ϕ3)∂(X1,X2,X3),Fij=∂ϕi∂Xje.x. when the material is on its rest position, F=I
Strain energy and hyperelasticity
the deformation energy is defined as
E[ϕ]=∫ΩΨ[ϕ;X]dXsince the local property is fully defined by deformation gradient
ϕ(X)=ϕ(X∗)+F(X∗)⋅(X−X∗)=F(X∗)⋅X+(ϕ(X∗)−F(X∗)⋅X∗)=F(X∗)⋅X+t∗thus we can write Ψ[ϕ;X]=Ψ[F], there are many energy models such as
Ψ[F]=k2||F||2F,Ψ[F]=k2||F−I||2FForce and traction
Since f=−∂E∂x, the force inner and on boundaries are defined:
- for the volume force, faggreagte(A)=∫Af(X)dX,A⊂Ω
- for the surface force, faggreagte(B)=∫Bτ(X)dS,B⊂∂Ω
First Piola-Kirchhoff stress tensor
P is a 3×3 tensor, defined as
P[F]=∂Ψ[F]∂F- τ=−P⋅N⟺τj=−PijNi
- f=∇X⋅P⟺fi=∂Pij∂Xj
the formula can be derived by calculus of variations
δE=δ[∫ΩΨ[F]dX]=∫ΩδΨ[F]dX=∫Ω[∂Ψ[F]∂F:δF]dX=∫Ω[P:δF]dX=∫ΩPijδFijdX=∫ΩPij∂δϕi∂XjdX=∫Ω∂∂Xj(Pijδϕi)−∂Pij∂XjδϕidX=−∫Ω∂Pij∂XjδϕidX+∫∂ΩPijNjδϕidS=−∫ΩfiδϕidX−∫∂ΩτiδϕidSConstitutive Models of Material
Strain Measures
Think of Ψ(F)=||F−I||2F, this form of deform energy is not zero when F is just a rigid rotation, so there is another measure to describe the deformation, named Green strain tensor
E=12(FTF−I)the Green strain tensor can handle both rest and rigid rotation situation.
Linear Elasticity Model
When F is a small disturb,
δE|F=I=12(δFTF+FTδF)=12(δFT+δF)ϵ=E(F)≈12(FT+F)−Ithen the terms of the strain energy density is
Ψ(F)=μϵ:ϵ+λ2tr2(ϵ)P(F)=2μϵ+λtr(ϵ)ISt. Vernan-Kickoff Model
When the deformation is large and F can no longer be represented by ϵ, then the energy density is
Ψ(F)=μE:E+λ2tr2(E)P(F)=F[2μE+λtr(E)I]There is a vital problem of StVK model, that when the material is compressed, the resistant force may decrease when deformation exceeds a threshold. This may results in the fail of the model.
e.x. For a tetrahedron defined by O(0,0,0),A(1,0,0),B(0,1,0),C(0,0,1), when C is compressed along z-axis by ratio l, the energy on it becomes Ψ=(μ+λ2)(l22−1)2, and the force becomes f=−(μ+λ2)(l2−2)l
Corotation Model
Another way to handle rotation is to polar decompose F=RS and compute Ψ(F)=Ψ(S). However, since the decomposition is costly, corotation model is not used widely.
Isotropic Model
An ideal energy function Ψ(F) should remain const when a rigid rotation applied to F, namely Ψ(RF)=Ψ(F). An isotropic model has another property that when the material coordinate rotate, the energy density remains const (isotropic), namely Ψ(FQ)=Ψ(F). F can be SVD decomposite to UTΣV, then Ψ(F)=Ψ(Σ)=Ψ(λ1,λ2,λ3)
there is another way to represent Ψ by invariant
I1=tr(FTF)=tr(Σ2)=3∑i=1λ2iI2=tr(FTFFTF)=tr(Σ4)=3∑i=1λ4iI3=det(FTF)=3∏i=1λ2iP(F)=∂Ψ∂I12F+∂Ψ∂I24FFTF+∂Ψ∂I32I3F−TNeo-hookean Model
In order to get over compress problems of StVK model, we can introduce log|F| into energy density to punish its compression. Neo-hookean model is a specific type of isotropic model.
Ψ(I1.I3)=μ2(I1−logI3−3)+λ8log2I3P(F)=μ(F−F−T)+λ2logI3F−TDynamics and Simulation
When we want to simulate the interaction of objects in computer, we get tetrahedron mesh representation of objects. Thus we model the whole continue material as piece-wise linear.
For each tetrahedron we can compute a const F and then using
Algorithms for Elastic Force
Deformation gradient F in each tetrahedron is uniform
F[X1−X4,X2−X4,X1−X4]=[x1−x4,x2−x4,x3−x4]F=Ds⋅BmDs=[x1−x4,x2−x4,x3−x4],Bm=[X1−X4,X2−X4,X1−X4]−1there is a small tip for force computing:
H=[f1,f2,f3]=P(F)⋅BTm1 | def precompute(): |
Algorithms for Stiffness Differential
The influence of δx on f for a single tetrahedron can be 12×12 matrix, since the 3-dim force on 4 vertices can be influenced by 3-dim position of 4 vertices. There is a way to compute this matrix column by column:
δH=[δf1,δf2,δf3]=δP(F,δF)⋅BTmδP(F,δF)=P(F+δF)−P(F)since δP(F,δF) is linear for δF, namely δP(F,λδF)=λδP(F,δF), we can feed different ∂F∂xij into it. Where xij is the i th element of j th vertex
Fij=∂F∂xij={δij,i={1,2,3},j≤3−δi1−δi2−δi3,i={1,2,3},j=41 | def computeGradient(): |
the method used in FEM simulation of 3D deformable solids: a practitioner’s guide to theory [1] is implicit, namely they only computing δf(x,δx), and then using iterative methods like conjugate gradient.
However, I introduce a method to compute stiffness matrix explicitly, for the reason that iterative methods are too sloooooow. According to my experiment in practice, implemented in Eigen, CG method is slower than simple Newton Method in a magnitude of 102 (3600 seconds vs 20 seconds )! So, I strongly recommend you to construct stiffness explicitly and use standard sparse linear algebra tools.
Dynamic Equation
The movement of objects obey Newton’s law
M¨x=fsum(x,v){˙x=vM˙v=fsum(x,v){xt+1=xt+Δt⋅vtvt+1=vt+Δt⋅M−1fsum(xt,vt)using backward Euler method
{xt+1=xt+Δt⋅vt+1vt+1=vt+Δt⋅M−1fsum(xt+1,vt+1)for each time step Δt, we need to try the solutions (xt+1,vt+1) for backward Euler equation iteratively until converge, denoted as x(0)t+1,x(1)t+1,…,x(k)t+1,…. Each iteration, we estimate fsum(x(k+1)t+1,v(k+1)t+1) by Taylor series approximation on (x(k)t+1,v(k)t+1)
define Δx=x(k+1)t+1−x(k)t+1,Δv=v(k+1)t+1−v(k)t+1, then we can get:
fsum(x(k+1)t+1,v(k+1)t+1)=fsum(x(k)t+1+Δx,v(k)t+1+Δv)≈fsum(x(k)t+1,v(k)t+1)−KΔx+γKΔvwhere K=−∂felas∂x|x=x(k)t+1,Kdamp=∂felas∂v|x=x(k)t+1=−γK
since v(k+1)t+1=v(k)t+1+Δv=v(k)t+1+ΔxΔt
v(k)t+1+ΔxΔt=vt+Δt⋅M−1(fsum(x(k)t+1,v(k)t+1)−KΔx+γKΔxΔt)then we can get the linear equation of Δx=x(k+1)t+1−x(k)t+1. Solve it, update, and enter next iteration, until converge.
[1Δt−Δt⋅(1−γΔt)M−1K]Δx=vt−v(k)t+1+Δt⋅M−1fsum(x(k)t+1,v(k)t+1)Reference
[1] Sifakis E, Barbic J. FEM simulation of 3D deformable solids: a practitioner’s guide to theory, discretization and model reduction[C]//ACM SIGGRAPH 2012 Courses. ACM, 2012: 20.